'\" t
.\"     Title: modbus_rtu_set_serial_mode
.\"    Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 10/06/2013
.\"    Manual: Libmodbus Manual
.\"    Source: libmodbus 3.0.4
.\"  Language: English
.\"
.TH "MODBUS_RTU_SET_SERIA" "3" "10/06/2013" "libmodbus 3\&.0\&.4" "Libmodbus Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
modbus_rtu_set_serial_mode \- set the serial mode
.SH "SYNOPSIS"
.sp
\fBint modbus_rtu_set_serial_mode(modbus_t *\fR\fB\fIctx\fR\fR\fB);\fR
.SH "DESCRIPTION"
.sp
The \fImodbus_rtu_set_serial_mode()\fR function shall set the selected serial mode:
.PP
\fBMODBUS_RTU_RS232\fR
.RS 4
the serial line is set for RS232 communication\&. RS\-232 (Recommended Standard 232) is the traditional name for a series of standards for serial binary single\-ended data and control signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit\-terminating Equipment)\&. It is commonly used in computer serial ports
.RE
.PP
\fBMODBUS_RTU_RS485\fR
.RS 4
the serial line is set for RS485 communication\&. EIA\-485, also known as TIA/EIA\-485 or RS\-485, is a standard defining the electrical characteristics of drivers and receivers for use in balanced digital multipoint systems\&. This standard is widely used for communications in industrial automation because it can be used effectively over long distances and in electrically noisy environments\&.
.RE
.sp
This function is only supported on Linux kernels 2\&.6\&.28 onwards\&.
.SH "RETURN VALUE"
.sp
The \fImodbus_set_serial_mode()\fR function shall return 0 if successful\&. Otherwise it shall return \-1 and set errno to one of the values defined below\&.
.SH "ERRORS"
.PP
\fBEINVAL\fR
.RS 4
The current libmodbus backend is not RTU\&.
.RE
.PP
\fBENOTSUP\fR
.RS 4
The function is not supported on your platform\&.
.RE
.sp
If the call to ioctl() fails, the error code of ioctl will be returned\&.
.SH "AUTHORS"
.sp
The libmodbus documentation was written by St\('ephane Raimbault <\m[blue]\fBstephane\&.raimbault@gmail\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
.SH "NOTES"
.IP " 1." 4
stephane.raimbault@gmail.com
.RS 4
\%mailto:stephane.raimbault@gmail.com
.RE
